<?php
		require_once "../includes/config.php";
		if($_GET['user']=="") {
			echo "Enter user name";
		}
		elseif($_GET['pass']=="") {
			echo "Enter password";
		}
		else {		
				$username=$_GET['user'];
				$password=$_GET['pass'];
				$sql_selusr="SELECT * FROM tbl_admin where username='$username' AND password='$password' AND status='a'";
				$rst_selusr=mysql_query($sql_selusr);
				if($rst_selusr) {	
					$num=mysql_num_rows($rst_selusr);
					$row_selusr=mysql_fetch_array($rst_selusr);
					$admin_id=$row_selusr['admin_id'];
					if($num>0)
					{
						$emsg="";			
						$_SESSION['admin_id']=$admin_id;
						$_SESSION['admin_name']=$username;
						//header("location:index.php?cat");
						echo "success";
					}
						else {
						echo "Invalid username and password, Enter valid one";
					}
				}				
		}	 
						
			?>
			


